<?php
/**
 * Created by yuxianjun001@icloud.com.
 * User: wuchen
 * Date: 2019/4/2
 * Time: 11:14
 */

namespace App\Http\Controllers\Api\Order;


use App\Http\Controllers\Common\MyController;
use App\Services\Order\BuyerOrderService;
use App\Services\User\UserService;
use Illuminate\Http\Request;

/**
 * 买家订单 类
 * Class BuyerOrderController
 * @package App\Http\Controllers\Api\Order
 */
class BuyerOrderController extends MyController
{
    private $service;

    public function __construct()
    {
        $this->service = new BuyerOrderService();
    }


    /**
     * 创建订单
     * @param Request $request
     */
    public function create(Request $request)
    {
        return $this->service->create($request);
    }


    //###############################以下为平台后台接口#############
    /**
     * 平台后端-订单列表
     * @param Request $request
     */
    public function listPlatForm(Request $request)
    {
        return $this->service->listPlatForm($request);

    }

    /**
     * 平台后端-订单详情
     * @param Request $request
     */
    public function infoPlatForm(Request $request)
    {
        return $this->service->infoPlatForm($request);

    }

    /**
     * 平台后端-备注订单
     * @param Request $request
     */
    public function remarkPlatForm(Request $request)
    {
        return $this->service->remarkPlatForm($request);
    }

    /**
     * 平台后端-关闭订单
     * @param Request $request
     */
    public function closePlatForm(Request $request)
    {
        return $this->service->closePlatForm($request);
    }

    /**
     * 平台后端-系统转单
     * @param Request $request
     */
    public function transferPlatForm(Request $request)
    {
        return $this->service->transferPlatForm($request);
    }

    /**
     * 骑手信息
     * @param Request $request
     * @return string
     */
    public function riderInfoPlatForm(Request $request)
    {
        return (new UserService())->userInfo($request);
    }

    /**
     * 用户信息
     * @param Request $request
     */
    public function userInfoPlatForm(Request $request)
    {
        return (new UserService())->userInfo($request);
    }

    /**
     * 获获取订单对应的用户收件地址
     * @param Request $request
     */
    public function buyerAddressPlatForm(Request $request)
    {
        return $this->service->buyerAddress($request);
    }


    //###############################以下为商家后台接口#############

    /**
     * 商家后端-订单列表
     * @param Request $request
     */
    public function listBusiness(Request $request)
    {
        return $this->service->listPlatForm($request);
    }

    /**
     * 商家后端-订单详情
     * @param Request $request
     */
    public function infoBusiness(Request $request)
    {
        return $this->service->infoPlatForm($request);

    }

    /**
     * 商家后端-备注订单
     * @param Request $request
     */
    public function remarkBusiness(Request $request)
    {
        return $this->service->remarkPlatForm($request);
    }

    /**
     * 商家后端-关闭订单
     * @param Request $request
     */
    public function closeBusiness(Request $request)
    {
        return $this->service->closePlatForm($request);

    }

    /**
     * 平台后端-系统转单
     * @param Request $request
     */
    public function transferBusiness(Request $request)
    {
        return $this->service->transferPlatForm($request);
    }

    /**
     * 骑手信息
     * @param Request $request
     * @return string
     */
    public function riderInfoBusiness(Request $request)
    {
        return (new UserService())->userInfo($request);
    }

    /**
     * 用户信息
     * @param Request $request
     */
    public function userInfoBusiness(Request $request)
    {
        return (new UserService())->userInfo($request);
    }

    /**
     * 获获取订单对应的用户收件地址
     * @param Request $request
     */
    public function buyerAddressBusiness(Request $request)
    {
        return $this->service->buyerAddress($request);
    }




}